@import '../style/var.scss';

.fc-tabs {
    position: relative;
    z-index: 5;
    overflow: hidden;

    &.body-fill {
        width: 100%;
        height: 100%;
    }

    &.fc-size-small {
        .fc-tabs-head {
            height: $ht-tab-bar - 20rpx;
        }

        .fc-tab-title {
            height: $ht-tab-bar - 20rpx;
            padding: 0 15rpx;
            font-size: $sz-tab-head - 6rpx;
            line-height: $ht-tab-bar - 20rpx;
        }

        .fc-tabs-body {
            top: $ht-tab-bar - 20rpx !important;
        }
    }

    &.json-tabs {
        .fc-tabs-head {
            background-color: transparent;
        }
    }
}

.fc-tabs-head {
    position: relative;
    z-index: 10;
    display: flex;
    flex-wrap: nowrap;
    color: $cr-tab-head;
    background: $bg-tab-head;
}

.fc-tabs-heads {
    display: flex;
    flex-wrap: nowrap;
}

.fc-tab-title {
    box-sizing: border-box;
    flex-shrink: 0;
    height: $ht-tab-bar;
    padding: 0 20rpx;
    font-size: $sz-tab-head;
    line-height: $ht-tab-bar;
    text-align: center;
}

.fc-tabs-horizontal {
    .fc-tabs-head-scroll {
        flex-basis: auto;
        flex-grow: 0;
        flex-shrink: 1;
        overflow: hidden;
    }

    .fc-tabs-head-before,
    .fc-tabs-head-after {
        flex-shrink: 0;
    }

    .fc-tabs-head {
        height: $ht-tab-bar;
        border-bottom: 1px solid $bg-tab-border;
    }

    .fc-tab-title {
        border-bottom: 6rpx solid transparent;
        transition: border-color 0.5s;

        &.active {
            border-bottom-color: $bg-tab-border-active;
        }
    }

    &.body-fill .fc-tabs-body {
        position: absolute;
        top: $ht-tab-bar;
        right: 0;
        bottom: 0;
        left: 0;
    }

    .fc-tab-panels {
        flex-direction: row;
    }

    .fc-tab-panel {
        width: 100%;
        overflow: hidden;
    }
}

.fc-tabs-vertical {
    .fc-tabs-head-scroll {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
    }

    .fc-tabs-head,
    .fc-tabs-body {
        top: 0;
        bottom: 0;
    }

    .fc-tabs-head {
        left: 0;
        flex-direction: column;
        width: 30%;
        border-right: 1px solid $bg-tab-border;
    }

    .fc-tabs-body {
        left: 30%;
        width: 70%;
    }

    .fc-tabs-heads {
        flex-direction: column;
    }

    .fc-tab-title {
        background-color: transparent;
        transition: background-color 0.5s;

        &.active {
            background-color: $bg-tab-border-active;
        }
    }

    .fc-tab-panels {
        flex-direction: column;
    }
}

.fc-tab-panels {
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    transition: transform 0.5s;

    .fc-tab-panel {
        position: relative;
        box-sizing: border-box;
        flex: 1;
        flex-shrink: 0;
    }
}
